//1.简介的写法

// let name = 'lili';
// let age = 18;

// let obj = {
//     name,
//     age,
//     fun(){
//         console.log(this.name)
//     }
// };

// console.log(obj)
// obj.fun()

// Object.is()  判断两个对象是否一致

// console.log(Object.is({name:'lili'},{name:'lili'})); //false

// console.log(Object.is(NaN,NaN))

// console.log(NaN === NaN)

// console.log(Object.is(+0,-0));

// console.log(+0===-0)

//Object.assgin()  合并对象

let obj1 = {name:'lili'};

let obj2 = {age:18};

// console.log({...obj1,...obj2},obj1,obj2);

// console.log(Object.assign({},obj1,obj2));

// console.log(Object.getOwnPropertyDescriptor(obj1,'name'))

// obj1.name = 'zs';

// console.log(obj1);

// delete obj1.name;  //删除对象的属性

Object.defineProperty(obj1,'name',{
    // writable:false,  //是否可写
    // enumerable:false,//是否可枚举
    configurable:false //是否可配置
})

// obj1.name = 'zs';
delete obj1.name;
console.log(obj1);

for(let item in obj1){ //循环的是可枚举的属性
    console.log(item)
}
